import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

/***引入组件***/
//管理首页整体
const AdminIndex = () => import(/* webpackChunkName: "AdminIndex" */ './views/admin/Index');
//首页信息
const AdminHome = () => import(/* webpackChunkName: "AdminHome" */ './views/admin/Home');
const UserManage = () => import(/* webpackChunkName: "UserManage" */ './views/admin/UserManage');

const routes = [
    {
        path: '/admin',
        name: 'adminIndex',
        component: AdminIndex,
        meta: {
            needLogin: true,
        },
        children: [
            { path: '/admin/home',name: 'adminHome', component: AdminHome },
            { path: '/admin/userManage',name: 'userManage', component: UserManage },
        ],
    },
    { path: '/**', redirect: '/admin', }
];

export default new Router({
    mode: 'hash',
    routes: routes
})
